<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManagerList.aspx.cs" Inherits="admin_Rights_ManagerList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>角色成员管理</title>
    <link rel="stylesheet" href="../skin/style.css" type="text/css" />
       <script type="text/javascript" src="../../js/jquery.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="itemtitle">
            管理员设置
        </div>
        <div class="itemtitle_tect">
            <p runat="server" id="menu">
                <a href="RoleAdd.aspx">添加角色</a> | <a href="RoleList.aspx">角色管理</a>
            </p>
        </div>
        <div class="clr">
        </div>
        <div class="talbe_border">
            <asp:GridView ID="grvManager" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
                AllowPaging="True" OnPageIndexChanging="grvManager_PageIndexChanging" GridLines="None"
                OnRowDataBound="grvManager_RowDataBound" OnRowDeleting="grvManager_RowDeleting"
                CellPadding="0" CssClass="talbe_list">
                <Columns>
                    <asp:BoundField DataField="ID" HeaderText="ID" />
                    <asp:BoundField DataField="ManagerName" HeaderText="管理员" />
                    <asp:BoundField DataField="RoleName" HeaderText="角色" />
                    <asp:BoundField DataField="LastIp" HeaderText="最近登录的IP" />
                    <asp:TemplateField HeaderText="最近登录时间">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# GetShortDate(Eval("LastDate").ToString()) %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="是否锁定">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtnUpdate" Font-Underline="false" runat="server" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID")+"|"+DataBinder.Eval(Container.DataItem, "Lockedup") %>'
                                Text='<%# DataBinder.Eval(Container.DataItem, "Lockedup").ToString()== "True" ? "已锁定" : "未锁定"%>'
                                OnCommand="lbtnUpdate_Command"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="编辑">
                        <ItemTemplate>
                            <%--<a href='ManagerEdit.aspx?ID=<%#Eval("ID") %>'>编辑</a>--%>
                            <asp:HyperLink ID="Edit" runat="server" NavigateUrl='<%# Eval("ID", "ManagerEdit.aspx?ID={0}") %>'>编辑</asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="删除" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                OnClientClick="return confirm('您确认要删除吗？')" Text="删除"></asp:LinkButton>
                                <asp:LinkButton ID="LinkButton2" runat="server" Enabled="false" Visible="false"
                                 Text="删除"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="header" />
            </asp:GridView>
        </div>
    </form>
</body>
</html>
